<template>
	<view class="uni-margin-wrap">
		<swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :indicator-color="dotColor"
		 :indicator-active-color="activeColor" :interval="interval" :duration="duration">
			<swiper-item v-for="item in imgList" :key="item.id">
				<view class="swiper-item">
					<image class="u-img" :src="item.src" @click="bannerTo(item.src)"></image>
				</view>
			</swiper-item>
		</swiper>
	</view>
</template>
<script>
	export default {
		props: {
			imgList:{
				type:Array,
				default:function () {
					return []
				}
			}
		},
		data() {
			return {
				indicatorDots: true,
				autoplay: true,
				interval: 2500,
				duration: 500,
				dotColor: '#fff',
				activeColor: 'rgba(255,255,255,0.6)',
			}
		},
		methods: {
			bannerTo(value) {
				this.$emit('goPage', value)
			}
		}
	}
</script>

<style>
	.uni-margin-wrap {
		width: 690rpx;
		margin: 20rpx 30rpx;
	}

	.swiper {
		height: 270rpx;
		width: 690rpx;
		background-color: #f1f3f6;
		border-radius: 12rpx;
	}
	.u-img{
		height: 270rpx;
		width: 690rpx;
		border-radius: 12rpx;
	}
</style>
